package org.jeecg.api.controller.us;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.recruit.contactInfo.entity.MmUsContactInfo;
import org.jeecg.modules.recruit.contactInfo.service.IMmUsContactInfoService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @ClassName WxUsContactInfoController
 * @Deacription TODO
 * @Author zhangle
 * @Date 2020/8/31 10:55
 * @Version 1.0
 **/
@RestController
@RequestMapping("/app/us")
@Api(tags = "APP-关于我们")
public class WxUsContactInfoController {
    @Resource
    private IMmUsContactInfoService mmUsContactInfoService;

    @ApiOperation(value="联系我们-分页列表查询", notes="联系我们-分页列表查询")
    @GetMapping(value = "/list")
    public Result<?> queryPageList(MmUsContactInfo mmUsContactInfo,
                                   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
                                   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
                                   HttpServletRequest req) {
        QueryWrapper<MmUsContactInfo> queryWrapper = QueryGenerator.initQueryWrapper(mmUsContactInfo, req.getParameterMap());
        Page<MmUsContactInfo> page = new Page<MmUsContactInfo>(pageNo, pageSize);
        IPage<MmUsContactInfo> pageList = mmUsContactInfoService.page(page, queryWrapper);
        return Result.ok(pageList);
    }
}
